Changes In "Not" Operator Syntax

image\regex2_shg.gif

The Regular Expression 'not' operator, !, was revised in Search and Replace version 3.1 to improve reliability and predictability of ! expressions. Longtime Search and Replace users may have noted in the past that when ! was combined with other operators it was sometimes difficult to anticipate what aspect of the total expression would be affected by the ! character. The syntax for ! is now explicit and, we hope, easier to understand & debug.

Previous users should familiarize themselves with the new syntax. Previous ! syntax may not work as it did before and existing scripts may need revision.

In general, the ! syntax now requires explicit expressions for both the string(s) to be found and the string(s) to not find. This can be thought of as "find something except what is specified by the ! expression".

For example, under the older syntax, to find "mat", "rat" or "sat" except in "bat" or "cat", the expression was !(b|c)at. Now the expression would be ?at!((b|c)at). In words, this can be thought of as "find something ending in 'at' except if it ends in 'b'at or 'c'at.

See ! - Not Operator for additional examples.

Notes: